<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateShippingTemplatesRegionTable extends Migration
{
    /**
     * 运费模板指定包邮关联表
     *
     * @return void
     */
    public function up()
    {
        Schema::create('shipping_templates_region', function (Blueprint $table) {
            $table->id()->comment('运费模板指定包邮关联表');
            $table->integer('province_id')->index()->comment('省id');
            $table->integer('temp_id')->index()->comment('模板id');
            $table->integer('city_id')->index()->comment('城市id');
            $table->decimal('first',10)->comment('首件');
            $table->decimal('first_price',10,2)->comment('首件运费');
            $table->decimal('continue',10)->comment('续件');
            $table->decimal('continue_price',10,2)->comment('续件运费');
            $table->string('region_type',16)->comment('计费方式:typeKet_one 按件数, typeKet_two 按重量, ypeKet_three 按体积');
            $table->integer('uniqid')->comment('分组唯一值');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('shipping_templates_region');
    }
}
